package com.oocl.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.oocl.dao.UserDao;
import com.oocl.dao.impl.UserDaoImpl;
import com.oocl.pojo.Users;
import com.oocl.service.UserService;

public class UserServiceImpl implements UserService{
	private UserDao userDao;
	
	public UserServiceImpl(){
		userDao = new UserDaoImpl();
	}
	
	
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}


	public List<String> loadNames() {
		List<Users> list = userDao.findAll();
		List<String> names = new ArrayList<String>();
		for(Users user :list){
			names.add(user.getName());
			System.out.println("load:"+user.getName());
		}
		return names;
	}
	
	

}
